/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$(function () {
    //表单提交
    $('#tj').click(function () {
        var dyc = $('#dyc').val();
        var ycr = $('#ycr').val();
        var ycsj_ks = $('#ycsj_ks').val();
        var ycsj_js = $('#ycsj_js').val();
        var yt = $('#yt').val();
        if (dyc == "") {
            $.toast("待用车不能为空", "forbidden");
            return;
        }
        if (ycr == "") {
            $.toast("用车人不能为空", "forbidden");
            return;
        }
        if (ycsj_ks == "") {
            $.toast("用车时间(始)不能为空", "forbidden");
            return;
        }
        if (ycsj_js == "") {
            $.toast("用车时间(终)不能为空", "forbidden");
            return;
        }
        $.showLoading();
        var o = new AjaxOptions();
        o.put('service_code', 'P90006');
        o.put('dyc', dyc);
        o.put('ycr', ycr);
        o.put('ycsj_ks', ycsj_ks);
        o.put('ycsj_js', ycsj_js);
        o.put('yt', yt);
        o.sus = function (data) {
            $.hideLoading();
            var sj = Math.random();
            $.toast("操作成功");
            window.location.href = window.location.href + sj;
        };
        o.fal = function (code, desc) {
            $.hideLoading();
            if (code == "9000601") {
                $.toast("登记用车失败！", "forbidden");
            }
        };
        $.ajax(o);
    });
});
